<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">

</head>
<body>
<div id="app">
    <h1>上传成功</h1>
    <br>
    <a th:href="@{/test/down}">下载文件</a>
    <br>

</div>

<script type="text/javascript" th:src="@{/js/vue.js}"></script>
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
<script type="text/javascript">

    var vue = new Vue({
        el: "#app",
        methods: {
            testAjax() {
                axios.post(
                    "/test/ajax?id=1001",
                    {username: "admin", password: "123456"}
                ).then(response => {
                    console.log(response.data);

                });
            },
            testRequestBody() {
                axios.post(
                    "/test/RequestBody/json",
                    {username: "admin", password: "123456", age: 23, gender: "男"}
                ).then(response => {
                    console.log(response.data);
                });
            },
            testResponseBody() {
                axios.post("/test/ResponseBody/json").then(response => {
                    console.log(response.data);
                });
            }
        }
    });
</script>
</body>
</html>